/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Redação_RádioPérola
 */
@Entity
@Table(name = "CLIENTE")
@NamedQueries({
    @NamedQuery(name = "Cliente.findAll", query = "SELECT c FROM Cliente c")})
public class Cliente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CLI_COD")
    private Integer cliCod;
    @Column(name = "CLI_NOM")
    private String cliNom;
    @Column(name = "CLI_CGC")
    private String cliCgc;
    @Column(name = "CLI_INS")
    private String cliIns;
    @Column(name = "CLI_TIP")
    private String cliTip;
    @Column(name = "CLI_SEX")
    private Character cliSex;
    @Column(name = "CLI_END")
    private String cliEnd;
    @Column(name = "CLI_NUM")
    private String cliNum;
    @Column(name = "CLI_CID")
    private Integer cliCid;
    @Column(name = "CLI_CEP")
    private String cliCep;
    @Column(name = "CLI_COM")
    private String cliCom;
    @Column(name = "CLI_TEL")
    private String cliTel;
    @Column(name = "CLI_CEL")
    private String cliCel;
    @Column(name = "CLI_CON")
    private String cliCon;
    @Column(name = "CLI_CHK")
    private Short cliChk;
    @Column(name = "CLI_EMA")
    private String cliEma;
    @Column(name = "CLI_FOR")
    private Short cliFor;
    @Column(name = "CLI_OBS")
    private String cliObs;
    @Column(name = "CLI_BLO")
    private Character cliBlo;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "CLI_LIM")
    private Double cliLim;
    @JoinColumn(name = "CLI_COD", referencedColumnName = "CID_COD", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Cidade cidade;
    @OneToMany(mappedBy = "cliente")
    private Collection<Produto> produtoCollection;

    public Cliente() {
    }

    public Cliente(Integer cliCod) {
        this.cliCod = cliCod;
    }

    public Integer getCliCod() {
        return cliCod;
    }

    public void setCliCod(Integer cliCod) {
        this.cliCod = cliCod;
    }

    public String getCliNom() {
        return cliNom;
    }

    public void setCliNom(String cliNom) {
        this.cliNom = cliNom;
    }

    public String getCliCgc() {
        return cliCgc;
    }

    public void setCliCgc(String cliCgc) {
        this.cliCgc = cliCgc;
    }

    public String getCliIns() {
        return cliIns;
    }

    public void setCliIns(String cliIns) {
        this.cliIns = cliIns;
    }

    public String getCliTip() {
        return cliTip;
    }

    public void setCliTip(String cliTip) {
        this.cliTip = cliTip;
    }

    public Character getCliSex() {
        return cliSex;
    }

    public void setCliSex(Character cliSex) {
        this.cliSex = cliSex;
    }

    public String getCliEnd() {
        return cliEnd;
    }

    public void setCliEnd(String cliEnd) {
        this.cliEnd = cliEnd;
    }

    public String getCliNum() {
        return cliNum;
    }

    public void setCliNum(String cliNum) {
        this.cliNum = cliNum;
    }

    public Integer getCliCid() {
        return cliCid;
    }

    public void setCliCid(Integer cliCid) {
        this.cliCid = cliCid;
    }

    public String getCliCep() {
        return cliCep;
    }

    public void setCliCep(String cliCep) {
        this.cliCep = cliCep;
    }

    public String getCliCom() {
        return cliCom;
    }

    public void setCliCom(String cliCom) {
        this.cliCom = cliCom;
    }

    public String getCliTel() {
        return cliTel;
    }

    public void setCliTel(String cliTel) {
        this.cliTel = cliTel;
    }

    public String getCliCel() {
        return cliCel;
    }

    public void setCliCel(String cliCel) {
        this.cliCel = cliCel;
    }

    public String getCliCon() {
        return cliCon;
    }

    public void setCliCon(String cliCon) {
        this.cliCon = cliCon;
    }

    public Short getCliChk() {
        return cliChk;
    }

    public void setCliChk(Short cliChk) {
        this.cliChk = cliChk;
    }

    public String getCliEma() {
        return cliEma;
    }

    public void setCliEma(String cliEma) {
        this.cliEma = cliEma;
    }

    public Short getCliFor() {
        return cliFor;
    }

    public void setCliFor(Short cliFor) {
        this.cliFor = cliFor;
    }

    public String getCliObs() {
        return cliObs;
    }

    public void setCliObs(String cliObs) {
        this.cliObs = cliObs;
    }

    public Character getCliBlo() {
        return cliBlo;
    }

    public void setCliBlo(Character cliBlo) {
        this.cliBlo = cliBlo;
    }

    public Double getCliLim() {
        return cliLim;
    }

    public void setCliLim(Double cliLim) {
        this.cliLim = cliLim;
    }

    public Cidade getCidade() {
        return cidade;
    }

    public void setCidade(Cidade cidade) {
        this.cidade = cidade;
    }

    public Collection<Produto> getProdutoCollection() {
        return produtoCollection;
    }

    public void setProdutoCollection(Collection<Produto> produtoCollection) {
        this.produtoCollection = produtoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cliCod != null ? cliCod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cliente)) {
            return false;
        }
        Cliente other = (Cliente) object;
        if ((this.cliCod == null && other.cliCod != null) || (this.cliCod != null && !this.cliCod.equals(other.cliCod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bean.Cliente[ cliCod=" + cliCod + " ]";
    }
    
}
